package com.netflix.hystrix.test;

/**
 * @Author Austin
 * @Description app
 * @Date 2022/8/15 16:42
 **/
public class App {

    public static void main(String[] args) throws Exception {
        for (int i = 0; i < 30; i++) {
            HelloHystrixCommand command = new HelloHystrixCommand();
            String result = command.execute();
            System.out.println("circuit breaker is open: " + command.isCircuitBreakerOpen());
            if (command.isCircuitBreakerOpen()) {
                Thread.sleep(500);
            }
            System.out.println("res: " + result);
        }
//        HelloHystrixCommand command = new HelloHystrixCommand();
//        String result = command.execute();
//        System.out.println(result);
    }

}
